package com.tutu.reggie.controller;

import com.tutu.reggie.common.R;
import com.tutu.reggie.entity.Orders;
import com.tutu.reggie.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author:JK.TuTu
 * @date:Created in 2022/9/2 16:35
 * @description:
 * @version: 1.0
 */
@Slf4j
@RequestMapping("/order")
@RestController
public class OrderController {

    @Autowired
    private OrderService orderService;


    /**
     * 结算  添加订单
     * @param orders
     */
    @PostMapping("/submit")
    public R<String> submit(@RequestBody Orders orders){
        log.info("订单详情:{}",orders);
        orderService.submit(orders);
        return R.success("添加成功！");
    }


}
